package com.miracle9.game.dao;
import com.miracle9.game.entity.ThousandFishRoom;
import org.hibernate.Query;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

@Repository
public class ThousandFishRoomDao extends SqlOperating<ThousandFishRoom, Integer>
{
  @CacheEvict(value={"springCache"}, key="'getThousandFishRoomById'+#id")
  public void updateDeskNumById(int deskNum, int id)
  {
    String hql = "update ThousandFishRoom set deskNum = deskNum + ? where id = ?";
    q_CreateSql(hql, new Object[] { Integer.valueOf(deskNum), Integer.valueOf(id) }).executeUpdate();
  }
  
  @Cacheable(value={"springCache"}, key="'getThousandFishRoomById'+#id")
  public ThousandFishRoom getById(int id)
  {
    return (ThousandFishRoom)getById(Integer.valueOf(id));
  }
}

